home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AEbrushTemplate.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  47.6 KB  |  1,229 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. // Copyright (C) 1997-1999 Alias|Wavefront,
  18. // a division of Silicon Graphics Limited.
  19. //
  20. // The information in this file is provided for the exclusive use of the
  21. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  22. // and incorporate this code into other products for purposes authorized
  23. // by the Alias|Wavefront license agreement, without fee.
  24. //
  25. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  26. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  27. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  28. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  29. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  30. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  31. // PERFORMANCE OF THIS SOFTWARE.
  32. //
  33. //
  34. //  Alias|Wavefront Script File
  35. //
  36. //  Creation Date:    May 15, 1997
  37. //
  38. //
  39. //  Procedure Name:
  40. //    AEbrushTemplate
  41. //
  42. //  Description Name;
  43. //    Creates the attribute editor controls for the brush Node
  44. //
  45. //  Input Value:
  46. //    nodeName 
  47. //
  48. //  Output Value:
  49. //    None
  50. // 
  51.  
  52.  
  53.  
  54. //
  55. //  Procedure Name:
  56. //    AEassignBrushTextureCB
  57. //
  58.  
  59. global proc int AEassignBrushTextureCB( string $fileAttribute,
  60.                                  string $fileName,
  61.                                  string $fileType )
  62. {
  63.     setAttr $fileAttribute -type "string" $fileName;
  64.  
  65.     string $currentDir = `workspace -q -dir`;
  66.     retainWorkingDirectory ($currentDir);
  67.  
  68.     return true;
  69. }
  70.  
  71. //
  72. //  Procedure Name:
  73. //    AEbrushTextureBrowser
  74. //
  75.  
  76. global proc AEbrushTextureBrowser( string $cmd )
  77. {
  78.     string  $workspace = `workspace -q -fn`;
  79.     setWorkingDirectory $workspace "image" "sourceImages";
  80.     
  81.     fileBrowser ($cmd, "Open", "image", 100);
  82. }
  83.  
  84. //
  85. //  Procedure Name:
  86. //    AEbrushTextureNameNew 
  87. //
  88.  
  89. global proc AEbrushTextureNameNew (string $fileAttribute)
  90. {
  91.     setUITemplate -pst attributeEditorTemplate;
  92.     rowLayout -nc 3 textureNameLayout;
  93.         text -l "Image Name";
  94.         textField textureNameField;
  95.             symbolButton -image "navButtonBrowse.xpm" browser;
  96.     setParent ..;
  97.     setUITemplate -ppt;
  98.     
  99.     AEbrushTextureNameReplace $fileAttribute;
  100. }
  101.  
  102. //
  103. //  Procedure Name:
  104. //    AEbrushTextureNameReplace
  105. //
  106.  
  107. global proc AEbrushTextureNameReplace (string $fileAttribute)
  108. {
  109.     connectControl -fileName textureNameField $fileAttribute;
  110.  
  111.     string $command = "AEassignBrushTextureCB "+" "+$fileAttribute;
  112.  
  113.     button -e -c
  114.         ("AEbrushTextureBrowser \"" + $command + "\"" ) browser;
  115. }
  116.  
  117.  
  118. global proc AEbrushCustomColor1New(string $label, int $idx, string $attrName1)
  119. {
  120.     global string $gAEbrushControls[];
  121.     $gAEbrushControls[$idx] = `attrColorSliderGrp
  122.         -l $label
  123.         -sb false
  124.         -at $attrName1
  125.         customColorSlider`;
  126. }
  127. global proc AEbrushCustomColor1Replace(string $label, int $idx, string $attrName1)
  128. {
  129.     global string $gAEbrushControls[];
  130.     attrColorSliderGrp
  131.         -edit
  132.         -at $attrName1
  133.         -l $label
  134.     $gAEbrushControls[$idx];
  135. }
  136. global proc checkBrushUseFrameExtension ( string $nodeName ) 
  137. {
  138.     string $nodeAttr = $nodeName + ".useFrameExtension";
  139.     int $value = `getAttr $nodeAttr`;
  140.     
  141.     if ( $value == 1 ) {
  142.         editorTemplate -dimControl $nodeName "frameExtension" false;
  143.     } else {
  144.         editorTemplate -dimControl $nodeName "frameExtension" true;
  145.     }
  146. }
  147.  
  148. //
  149. //  Procedure Name:
  150. //    AEbrushTemplate
  151. //
  152. global proc AEbrushTemplate ( string $nodeName )
  153. {
  154.     editorTemplate -beginNoOptimize;
  155.     
  156.     editorTemplate -beginScrollLayout;
  157.  
  158.         editorTemplate -addControl "brushType" "checkType";
  159.         editorTemplate -addControl "globalScale";
  160.         editorTemplate -beginLayout "Channels" -collapse 1;
  161.             editorTemplate -addControl "depth" "checkDepth";
  162.             editorTemplate -addControl "modifyDepth";
  163.             editorTemplate -addControl "modifyColor";
  164.             editorTemplate -addControl "modifyAlpha";
  165.         editorTemplate -endLayout;
  166.         editorTemplate -beginLayout "Brush Profile" -collapse 1;
  167.             editorTemplate -addControl "brushWidth";
  168.             editorTemplate -addControl "softness";
  169.             editorTemplate -addControl "flatness1";
  170.             editorTemplate -addControl "flatness2";
  171.             editorTemplate -addControl "twist";
  172.             editorTemplate -addControl "forwardTwist";
  173.             editorTemplate -addControl "stampDensity";
  174.             editorTemplate -addControl "screenspaceWidth";
  175.         editorTemplate -endLayout;
  176.         editorTemplate -beginLayout "Thin Line Multi Streaks" -collapse 1;
  177.             editorTemplate -addControl "multiStreaks";
  178.             editorTemplate -addControl "multiStreakSpread1";
  179.             editorTemplate -addControl "multiStreakSpread2";
  180.             editorTemplate -label "Diffuse Random" -addControl "multiStreakDiffuseRand";
  181.             editorTemplate -label "Specular Random" -addControl "multiStreakSpecularRand";
  182.             editorTemplate -label "Light All Streaks" -addControl "multiStreakLightAll";
  183.         editorTemplate -endLayout;
  184.  
  185.         editorTemplate -beginLayout "Mesh" -collapse 1;
  186.             editorTemplate -addControl "tubeSections";
  187.             editorTemplate -addControl "subSegments";
  188.             editorTemplate -addControl "singleSided";
  189.             editorTemplate -addControl "perPixelLighting";
  190.             editorTemplate -addControl "endCaps";
  191.             editorTemplate -addControl "hardEdges";
  192.             editorTemplate -beginLayout "Thorns on Mesh" -collapse 1;
  193.                 editorTemplate -addControl "branchThorns" "checkThorns";
  194.                 editorTemplate -addControl "twigThorns" "checkThorns";
  195.                 editorTemplate -addControl "leafThorns" "checkThorns";
  196.                 editorTemplate -addControl "flowerThorns";
  197.                 editorTemplate -addControl "thornDensity";
  198.                 editorTemplate -addControl "thornElevation";
  199.                 editorTemplate -addControl "thornLength";
  200.                 editorTemplate -addControl "thornBaseWidth";
  201.                 editorTemplate -addControl "thornTipWidth";
  202.                 editorTemplate -addControl "thornSpecular";
  203.                 editorTemplate -addControl "thornBaseColor";
  204.                 editorTemplate -addControl "thornTipColor";
  205.             editorTemplate -endLayout;
  206.             editorTemplate -beginLayout "Mesh Environment Reflections" -collapse 1;
  207.                 editorTemplate -addControl "branchReflectivity";
  208.                 editorTemplate -addControl "leafReflectivity";
  209.                 editorTemplate -addControl "flowerReflectivity";
  210.                 AEaddRampControl "environment";
  211.                 AEaddRampControl "reflectionRolloff";
  212.             editorTemplate -endLayout;
  213.         editorTemplate -endLayout;
  214.  
  215.  
  216.         editorTemplate -beginLayout "Shading" -collapse 1;
  217.             editorTemplate -suppress "color1";
  218.             editorTemplate -callCustom
  219.                 "AEbrushCustomColor1New \"Color1\" 1"
  220.                 "AEbrushCustomColor1Replace \"Color1\" 1"
  221.                 "color1";
  222.             editorTemplate -suppress "incandescence1";
  223.             editorTemplate -callCustom
  224.                 "AEbrushCustomColor1New \"Incandescence1\" 2"
  225.                 "AEbrushCustomColor1Replace \"Incandescence1\" 2"
  226.                 "incandescence1";
  227.             editorTemplate -suppress "transparency1";
  228.             editorTemplate -callCustom
  229.                 "AEbrushCustomColor1New \"Transparency1\" 3"
  230.                 "AEbrushCustomColor1Replace \"Transparency1\" 3"
  231.                 "transparency1";
  232.             editorTemplate -addControl "blurIntensity" "checkType";
  233.             editorTemplate -addControl "edgeAntialias";
  234.             editorTemplate -beginLayout "    Tube Shading" -collapse 1;
  235.                 editorTemplate -suppress "color2";
  236.                 editorTemplate -callCustom
  237.                     "AEbrushCustomColor1New \"Color2\" 4"
  238.                     "AEbrushCustomColor1Replace \"Color2\" 4"
  239.                     "color2";
  240.                 editorTemplate -suppress "incandescence2";
  241.                 editorTemplate -callCustom
  242.                     "AEbrushCustomColor1New \"Incandescence2\" 5"
  243.                     "AEbrushCustomColor1Replace \"Incandescence2\" 5"
  244.                     "incandescence2";
  245.                 editorTemplate -suppress "transparency2";
  246.                 editorTemplate -callCustom
  247.                     "AEbrushCustomColor1New \"Transparency2\" 6"
  248.                     "AEbrushCustomColor1Replace \"Transparency2\" 6"
  249.                     "transparency2";
  250.                 editorTemplate -addControl "hueRand";
  251.                 editorTemplate -addControl "satRand";
  252.                 editorTemplate -addControl "valRand";
  253.                 editorTemplate -addControl "brightnessRand";
  254.                 editorTemplate -addControl "rootFade";
  255.                 editorTemplate -addControl "tipFade";
  256.             editorTemplate -endLayout;
  257.         editorTemplate -endLayout;
  258.  
  259.  
  260.         editorTemplate -beginLayout "Texturing" -collapse 1;
  261.             
  262.             editorTemplate -addControl "mapColor" "checkMapping";
  263.             editorTemplate -addControl "texColorScale";
  264.             editorTemplate -addControl "texColorOffset";
  265.             editorTemplate -addSeparator;
  266.             editorTemplate -addControl "mapOpacity" "checkMapping";
  267.             editorTemplate -addControl "texOpacityScale";
  268.             editorTemplate -addControl "texOpacityOffset";
  269.             editorTemplate -addSeparator;
  270.             editorTemplate -addControl "mapDisplacement" "checkMapping";
  271.             editorTemplate -addControl "displacementScale";
  272.             editorTemplate -addControl "displacementOffset";
  273.             editorTemplate -addControl "bumpIntensity";
  274.             editorTemplate -addControl "bumpBlur";
  275.             editorTemplate -addControl -label "Use Luminance" "luminanceIsDisplacement";
  276.             editorTemplate -addSeparator;
  277.             editorTemplate -addControl "textureType" "checkMapping";
  278.             editorTemplate -addControl "mapMethod";
  279.             editorTemplate -addControl "texUniformity";
  280.             editorTemplate -suppress "texColor1";
  281.             editorTemplate -callCustom
  282.                 "AEbrushCustomColor1New \"Tex Color1\" 7"
  283.                 "AEbrushCustomColor1Replace \"Tex Color1\" 7"
  284.                 "texColor1";
  285.             editorTemplate -suppress "texColor2";
  286.             editorTemplate -callCustom
  287.                 "AEbrushCustomColor1New \"Tex Color2\" 8"
  288.                 "AEbrushCustomColor1Replace \"Tex Color2\" 8"
  289.                 "texColor2";
  290.             editorTemplate -addControl "texAlpha1";
  291.             editorTemplate -addControl "texAlpha2";
  292.                 editorTemplate -addControl "repeatU";
  293.             editorTemplate -addControl "repeatV";
  294.             editorTemplate -addControl "offsetU";
  295.             editorTemplate -addControl "offsetV";
  296.             editorTemplate -addControl "blurMult";
  297.             editorTemplate -addControl "smear";
  298.             editorTemplate -addControl "smearU";
  299.             editorTemplate -addControl "smearV";
  300.             editorTemplate -addSeparator;
  301.             editorTemplate -suppress "imageName";
  302.             editorTemplate -callCustom "AEbrushTextureNameNew" 
  303.                     "AEbrushTextureNameReplace" 
  304.                     "imageName";
  305.             editorTemplate -addControl "useFrameExtension" "checkBrushUseFrameExtension";
  306.             editorTemplate -addControl "frameExtension";    
  307.             editorTemplate -addControl "fringeRemoval";
  308.             editorTemplate -addSeparator;
  309.             editorTemplate -addControl "fractalAmplitude";
  310.             editorTemplate -addControl "fractalRatio";
  311.             editorTemplate -addControl "fractalThreshold";
  312.             
  313.         editorTemplate -endLayout;
  314.  
  315.     
  316.         editorTemplate -beginLayout "Illumination" -collapse 1;
  317.         
  318.             editorTemplate -addControl "illuminated" "checkIllumination";
  319.             editorTemplate -addControl "realLights" "checkIllumination";
  320.             editorTemplate -addControl "lightDirection";
  321.             editorTemplate -addSeparator;
  322.             editorTemplate -addControl "translucence";
  323.             editorTemplate -addSeparator;
  324.             editorTemplate -addControl "specular";
  325.             editorTemplate -addControl "specularPower";
  326.             editorTemplate -suppress "specularColor";
  327.             editorTemplate -callCustom
  328.                 "AEbrushCustomColor1New \"Specular Color\" 9"
  329.                 "AEbrushCustomColor1Replace \"Specular Color\" 9"
  330.                 "specularColor";
  331.         
  332.         editorTemplate -endLayout;
  333.  
  334.         editorTemplate -beginLayout "Shadow Effects" -collapse 1;
  335.         
  336.             editorTemplate -addControl "fakeShadow" "checkFakeShadow";
  337.             editorTemplate -addControl "shadowDiffusion";
  338.             editorTemplate -addControl "shadowOffset";
  339.             editorTemplate -label "Shadow Transp." -addControl "shadowTransparency";
  340.             editorTemplate -addSeparator;
  341.             editorTemplate -addControl "backShadow";
  342.             editorTemplate -addControl "centerShadow";
  343.             editorTemplate -addSeparator;
  344.             editorTemplate -addControl "depthShadowType";
  345.             editorTemplate -addControl "depthShadow";
  346.             editorTemplate -addControl "depthShadowDepth";
  347.             editorTemplate -addSeparator;
  348.             editorTemplate -addControl "castShadows";
  349.         
  350.         editorTemplate -endLayout;
  351.  
  352.         editorTemplate -beginLayout "Glow" -collapse 1;
  353.             editorTemplate -addControl "glow";
  354.             editorTemplate -suppress "glowColor";
  355.             editorTemplate -callCustom
  356.                 "AEbrushCustomColor1New \"Glow Color\" 10"
  357.                 "AEbrushCustomColor1Replace \"Glow Color\" 10"
  358.                 "glowColor";
  359.  
  360.             editorTemplate -addControl "glowSpread";
  361.             editorTemplate -addSeparator;
  362.             editorTemplate -addControl "shaderGlow";
  363.         editorTemplate -endLayout;
  364.  
  365.         editorTemplate -beginLayout "Tubes" -collapse 1;
  366.             editorTemplate -addControl "tubes" "checkTubes";
  367.             editorTemplate -addControl "tubeCompletion";
  368.         
  369.             editorTemplate -beginLayout "    Creation" -collapse 1;
  370.                 editorTemplate -addControl "tubesPerStep";
  371.                 editorTemplate -addControl "tubeRand";
  372.                 editorTemplate -addControl "startTubes";
  373.                 editorTemplate -addControl "segments";
  374.                 editorTemplate -addSeparator;
  375.                 editorTemplate -addControl "lengthMin";
  376.                 editorTemplate -addControl "lengthMax";
  377.                 editorTemplate -addSeparator;
  378.                 editorTemplate -addControl "tubeWidth1";
  379.                 editorTemplate -addControl "tubeWidth2";
  380.                 editorTemplate -addControl "widthRand";
  381.                 editorTemplate -addControl "widthBias";
  382.                 editorTemplate -addSeparator;
  383.                 editorTemplate -addControl "segmentLengthBias";
  384.                 editorTemplate -addControl "segmentWidthBias";
  385.                 editorTemplate -addSeparator;
  386.                 AEaddRampControl "widthScale";
  387.                 editorTemplate -addSeparator;
  388.                 editorTemplate -addControl "tubeDirection";
  389.                 editorTemplate -addControl "elevationMin";
  390.                 editorTemplate -addControl "elevationMax";
  391.                 editorTemplate -addControl "azimuthMin";
  392.                 editorTemplate -addControl "azimuthMax";
  393.                 editorTemplate -addSeparator;
  394.                 editorTemplate -addControl "simplifyMethod";
  395.             editorTemplate -endLayout;
  396.         
  397.             editorTemplate -beginLayout "    Growth" -collapse 1;
  398.                     editorTemplate -addControl "branches" "checkBranches";
  399.                     editorTemplate -addControl "twigs" "checkTwigs";
  400.                     editorTemplate -addControl "leaves" "checkLeaves";
  401.                     editorTemplate -addControl "flowers" "checkFlowers";
  402.                     editorTemplate -addControl "buds" "checkBuds";
  403.                 editorTemplate -beginLayout "        Branches" -collapse 1;
  404.             
  405.                     editorTemplate -addControl "startBranches";
  406.                     editorTemplate -addControl "numBranches";
  407.                     editorTemplate -addControl "splitMaxDepth";
  408.                     editorTemplate -addControl "branchDropout";
  409.                     editorTemplate -addControl "splitRand";
  410.                     editorTemplate -addControl "splitAngle";
  411.                     editorTemplate -addControl "splitTwist";
  412.                     editorTemplate -addControl "splitSizeDecay";            
  413.                     editorTemplate -addControl "splitBias";
  414.                     editorTemplate -addControl "minSize";
  415.                     editorTemplate -addControl "middleBranch";
  416.             
  417.                 editorTemplate -endLayout;
  418.                 editorTemplate -beginLayout "        Twigs" -collapse 1;
  419.             
  420.                     editorTemplate -addControl "twigsInCluster";
  421.                     editorTemplate -addControl "numTwigClusters";
  422.                     editorTemplate -addControl "twigDropout";
  423.                     editorTemplate -addSeparator;
  424.                     editorTemplate -addControl "twigLength";
  425.                     editorTemplate -addControl "twigBaseWidth";
  426.                     editorTemplate -addControl "twigTipWidth";
  427.                     editorTemplate -addControl "twigStart";
  428.                     editorTemplate -addControl "twigAngle1";
  429.                     editorTemplate -addControl "twigAngle2";
  430.                     editorTemplate -addControl "twigTwist";
  431.                     editorTemplate -addControl "twigStiffness";
  432.                     editorTemplate -addControl "branchAfterTwigs";
  433.                     AEaddRampControl "twigLengthScale";
  434.             
  435.                 editorTemplate -endLayout;
  436.     
  437.                 editorTemplate -beginLayout "        Leaves" -collapse 1;
  438.             
  439.                     editorTemplate -addControl "leavesInCluster";
  440.                     editorTemplate -addControl "numLeafClusters";
  441.                     editorTemplate -addControl "leafDropout";
  442.                     editorTemplate -addSeparator;
  443.                     editorTemplate -addControl "leafLength";
  444.                     editorTemplate -addControl "leafBaseWidth";
  445.                     editorTemplate -addControl "leafTipWidth";
  446.                     AEaddRampControl "leafWidthScale";
  447.                     editorTemplate -addControl "leafStart";
  448.                     editorTemplate -addControl "leafAngle1";
  449.                     editorTemplate -addControl "leafAngle2";
  450.                     editorTemplate -addControl "leafTwist";
  451.                     editorTemplate -addControl "leafForwardTwist";
  452.                     editorTemplate -addControl "leafBend";
  453.                     AEaddRampControl "leafCurl";
  454.                     editorTemplate -addControl "leafTwirl";
  455.                     editorTemplate -addControl "leafSegments";
  456.                     editorTemplate -addControl "leafFlatness";
  457.                     editorTemplate -addControl "leafSizeDecay";
  458.                     editorTemplate -addControl "leafStiffness";
  459.                     editorTemplate -addControl "leafTranslucence";
  460.                     editorTemplate -addControl "leafSpecular";
  461.                     editorTemplate -addSeparator;
  462.                     editorTemplate -suppress "leafColor1";
  463.                     editorTemplate -callCustom
  464.                         "AEbrushCustomColor1New \"Leaf Color1\" 11"
  465.                         "AEbrushCustomColor1Replace \"Leaf Color1\" 11"
  466.                         "leafColor1";
  467.                     editorTemplate -suppress "leafColor2";
  468.                     editorTemplate -callCustom
  469.                         "AEbrushCustomColor1New \"Leaf Color2\" 12"
  470.                         "AEbrushCustomColor1Replace \"Leaf Color2\" 12"
  471.                         "leafColor2";
  472.                     editorTemplate -addControl "leafHueRand";
  473.                     editorTemplate -addControl "leafSatRand";
  474.                     editorTemplate -addControl "leafValRand";
  475.                     editorTemplate -addSeparator;
  476.                     editorTemplate -addControl "leafUseBranchTex" "checkLeafUseBranchTex";
  477.                     editorTemplate -suppress "leafImage";
  478.                     editorTemplate -callCustom "AEbrushTextureNameNew" 
  479.                         "AEbrushTextureNameReplace" 
  480.                         "leafImage";
  481.                     editorTemplate -addSeparator;
  482.                     editorTemplate -addControl "terminalLeaf";
  483.                 
  484.                 editorTemplate -endLayout;
  485.                 editorTemplate -beginLayout "        Flowers" -collapse 1;
  486.                 
  487.                     editorTemplate -addControl "petalsInFlower";
  488.                     editorTemplate -addControl "numFlowers";
  489.                     editorTemplate -addControl "petalDropout";
  490.                     editorTemplate -addSeparator;
  491.                     editorTemplate -addControl "petalLength";
  492.                     editorTemplate -addControl "petalBaseWidth";
  493.                     editorTemplate -addControl "petalTipWidth";
  494.                     AEaddRampControl "petalWidthScale";
  495.                     editorTemplate -addControl "flowerStart";
  496.                     editorTemplate -addControl "flowerAngle1";
  497.                     editorTemplate -addControl "flowerAngle2";
  498.                     editorTemplate -addControl "flowerTwist";
  499.                     editorTemplate -addControl "petalForwardTwist";
  500.                     editorTemplate -addControl "petalBend";
  501.                     AEaddRampControl "petalCurl";
  502.                     editorTemplate -addControl "petalTwirl";
  503.                     editorTemplate -addControl "petalSegments";
  504.                     editorTemplate -addControl "petalFlatness";
  505.                     editorTemplate -addControl "flowerSizeDecay";
  506.                     editorTemplate -addControl "flowerStiffness";
  507.                     editorTemplate -addSeparator;
  508.                     editorTemplate -addControl "flowerTranslucence";
  509.                     editorTemplate -addControl "flowerSpecular";
  510.                     editorTemplate -suppress "petalColor1";
  511.                     editorTemplate -callCustom
  512.                         "AEbrushCustomColor1New \"Petal Color1\" 13"
  513.                         "AEbrushCustomColor1Replace \"Petal Color1\" 13"
  514.                         "petalColor1";
  515.                     editorTemplate -suppress "petalColor2";
  516.                     editorTemplate -callCustom
  517.                         "AEbrushCustomColor1New \"Petal Color2\" 14"
  518.                         "AEbrushCustomColor1Replace \"Petal Color2\" 14"
  519.                         "petalColor2";
  520.                     editorTemplate -addControl "flowerHueRand";    
  521.                     editorTemplate -addControl "flowerSatRand";                
  522.                     editorTemplate -addControl "flowerValRand";
  523.                     editorTemplate -addSeparator;
  524.                     editorTemplate -addControl "flowerUseBranchTex" "checkFlowerUseBranchTex";
  525.                     editorTemplate -suppress "flowerImage";
  526.                     editorTemplate -callCustom "AEbrushTextureNameNew" 
  527.                         "AEbrushTextureNameReplace" 
  528.                         "flowerImage";
  529.                     
  530.                 editorTemplate -endLayout;
  531.                 editorTemplate -beginLayout "        Buds" -collapse 1;
  532.                     
  533.                     editorTemplate -addControl "budSize";
  534.  
  535.                     editorTemplate -suppress "budColor";
  536.                     editorTemplate -callCustom
  537.                         "AEbrushCustomColor1New \"Bud Color\" 15"
  538.                         "AEbrushCustomColor1Replace \"Bud Color\" 15"
  539.                         "budColor";
  540.                     
  541.                 editorTemplate -endLayout;
  542.             editorTemplate -endLayout;
  543.             editorTemplate -beginLayout "    Behavior" -collapse 1;
  544.                 editorTemplate -beginLayout "        Displacement" -collapse 1;
  545.                 
  546.                     editorTemplate -addControl "displacementDelay";
  547.                     editorTemplate -addSeparator;
  548.                     editorTemplate -addControl "noise";
  549.                     editorTemplate -addControl "noiseFrequency";
  550.                     editorTemplate -addControl "noiseOffset";
  551.                     editorTemplate -addSeparator;
  552.                     editorTemplate -addControl "wiggle";
  553.                     editorTemplate -addControl "wiggleFrequency";
  554.                     editorTemplate -addControl "wiggleOffset";
  555.                     editorTemplate -addSeparator;
  556.                     editorTemplate -addControl "curl";
  557.                     editorTemplate -addControl "curlFrequency";
  558.                     editorTemplate -addControl "curlOffset";
  559.                     
  560.                 editorTemplate -endLayout;
  561.                 editorTemplate -beginLayout "        Forces" -collapse 1;            
  562.                     
  563.                     editorTemplate -addControl "pathFollow";
  564.                     editorTemplate -addControl "pathAttract";
  565.                     editorTemplate -addSeparator;
  566.                     editorTemplate -addControl "curveFollow";
  567.                     editorTemplate -addControl "curveAttract";
  568.                     editorTemplate -addControl "curveMaxDist";
  569.                     editorTemplate -addSeparator;
  570.                     editorTemplate -addControl "random";
  571.                     editorTemplate -addSeparator;
  572.                     editorTemplate -addControl "uniformForce";
  573.                     editorTemplate -addSeparator;
  574.                     editorTemplate -addControl "gravity";
  575.                     editorTemplate -addSeparator;
  576.                     editorTemplate -addControl "deflection" "checkDeflection";
  577.                     editorTemplate -addControl "deflectionMin";
  578.                     editorTemplate -addControl "deflectionMax";
  579.                     editorTemplate -addSeparator;
  580.                     editorTemplate -addControl "momentum";
  581.                     editorTemplate -addSeparator;
  582.                     editorTemplate -addControl "lengthFlex";
  583.                     
  584.                 editorTemplate -endLayout;
  585.                 editorTemplate -beginLayout "        Turbulence" -collapse 1;            
  586.                 
  587.                     editorTemplate -addControl "turbulenceType" "checkTurbulence";
  588.                     editorTemplate -label "Interpolation" -addControl "turbulenceInterpolation";
  589.                     editorTemplate -addControl "turbulence";
  590.                     editorTemplate -label "Frequency" -addControl "turbulenceFrequency";
  591.                     editorTemplate -addControl "turbulenceSpeed";
  592.                     editorTemplate -addControl "turbulenceOffset";
  593.                     
  594.                 editorTemplate -endLayout;
  595.                 editorTemplate -beginLayout "        Spiral" -collapse 1;            
  596.                     
  597.                     editorTemplate -addControl "spiralMin";
  598.                     editorTemplate -addControl "spiralMax";
  599.                     editorTemplate -addControl "spiralDecay";
  600.                     
  601.                 editorTemplate -endLayout;
  602.                 editorTemplate -beginLayout "        Bend" -collapse 1;            
  603.                     
  604.                     editorTemplate -addControl "bend";
  605.                     editorTemplate -addControl "bendBias";
  606.                     
  607.                 editorTemplate -endLayout;                    
  608.                 editorTemplate -beginLayout "        Twist" -collapse 1;            
  609.                     
  610.                     editorTemplate -addControl "twistRate";
  611.                     editorTemplate -addControl "twistRand";
  612.                     
  613.                 editorTemplate -endLayout;                    
  614.             editorTemplate -endLayout;
  615.             editorTemplate -beginLayout "    Length Mappings" -collapse 1;            
  616.                 
  617.                 editorTemplate -addControl "colorLengthMap";
  618.                 editorTemplate -addControl "transpLengthMap";
  619.                 editorTemplate -addControl "incandLengthMap";
  620.                 editorTemplate -addControl "widthLengthMap";
  621.                 editorTemplate -addControl "splitLengthMap";
  622.  
  623.             editorTemplate -endLayout;
  624.             editorTemplate -beginLayout "    User MEL Scripts" -collapse 1;
  625.                 editorTemplate -addControl "creationScript";
  626.                 editorTemplate -addControl "runtimeScript";
  627.             editorTemplate -endLayout;
  628.         editorTemplate -endLayout;
  629.         editorTemplate -beginLayout "Gaps" -collapse 1;            
  630.                                     
  631.             editorTemplate -addControl "gapSize";
  632.             editorTemplate -addControl "gapSpacing";
  633.             editorTemplate -addControl "gapRand";
  634.             
  635.         editorTemplate -endLayout;
  636.         editorTemplate -beginLayout "Flow Animation" -collapse 1;            
  637.             editorTemplate -addControl "flowSpeed";
  638.             editorTemplate -addControl "textureFlow";
  639.             editorTemplate -addControl "strokeTime";
  640.             editorTemplate -addControl "timeClip" "checkTimeClip";
  641.             editorTemplate -label "Start Time (seconds)" -addControl "startTime";
  642.             editorTemplate -label "End Time (seconds)" -addControl "endTime";
  643.             editorTemplate -addControl "time";
  644.         editorTemplate -endLayout;
  645.  
  646.         // include/call base class/node attributes
  647.         AEdependNodeTemplate $nodeName;
  648.  
  649.     editorTemplate -addExtraControls;
  650.     editorTemplate -endScrollLayout;
  651.     
  652.     editorTemplate -endNoOptimize;
  653. }
  654.  
  655. // Dimming Code
  656.  
  657. global proc checkMapping(string $node)
  658. {
  659.     global string $gAEbrushControls[];
  660.     int $val1 = `getAttr ($node+".mapColor")`;
  661.     int $val2 = `getAttr ($node+".mapOpacity")`;
  662.     int $val3 = `getAttr ($node+".mapDisplacement")`;
  663.     int $ttype = `getAttr ($node+".textureType")`;
  664.     float $color1[3] = `getAttr ($node+".color1")`;
  665.     int $bType = `getAttr ($node+".brushType")`;
  666.     int $illum = `getAttr ($node+".illuminated")`;
  667.     $val3 = $val3 && ($bType == 5); //displacement only if meshtype
  668.     int $val = 1;
  669.     if ( $val1 + $val2 + $val3 > 0 ){
  670.         $val = 0;
  671.     }
  672.  
  673.     if ($val1) {
  674.         // We are mapping color, so check that color1 is not 0 to insure the effect
  675.         // of mapping appears.
  676.         if ($color1[0] == 0 && $color1[1] == 0 && $color1[2] == 0) {
  677.             // We might want to check to see if the values are attached, but it is unlikely,
  678.             // so, we do not.
  679.             setAttr ($node+".color1") 1 1 1;
  680.         }
  681.     }
  682.     
  683.     editorTemplate -dimControl $node "displacementScale" (!$val3);
  684.     editorTemplate -dimControl $node "displacementOffset" (!$val3);
  685.     editorTemplate -dimControl $node "bumpIntensity" (!$val3 || !$illum);
  686.     editorTemplate -dimControl $node "bumpBlur" (!$val3 || !$illum);
  687.     editorTemplate -dimControl $node "luminanceIsDisplacement" (!$val3);
  688.  
  689.     editorTemplate -dimControl $node "textureType" $val;
  690. //    editorTemplate -dimControl $node "texColor1" $val;
  691. //    editorTemplate -dimControl $node "texColor2" $val;
  692.  
  693.     //    Bug fix #117048.  The dangers of using global strings...
  694.     //
  695.     //    The global string values are not reset to null when the corresponding
  696.     //    controls are deleted.  To fix this, simply ensure the control exists
  697.     //    before editting it.  27jul99 - bwk
  698.     //
  699.     if (`attrColorSliderGrp -exists $gAEbrushControls[7]`) {
  700.         attrColorSliderGrp -edit -en ($val1) $gAEbrushControls[7];
  701.     }
  702.     if (`attrColorSliderGrp -exists $gAEbrushControls[8]`) {
  703.         attrColorSliderGrp -edit -en ($val1) $gAEbrushControls[8];
  704.     }
  705.     
  706.     editorTemplate -dimControl $node "texColorScale" (!$val1);
  707.     editorTemplate -dimControl $node "texColorOffset" (!$val1);
  708.     editorTemplate -dimControl $node "texOpacityScale" (!$val2);
  709.     editorTemplate -dimControl $node "texOpacityOffset" (!$val2);
  710.     editorTemplate -dimControl $node "texAlpha1" (!($val2 || $val3));
  711.     editorTemplate -dimControl $node "texAlpha2" (!($val2 || $val3));
  712.     editorTemplate -dimControl $node "mapMethod" ($val || ($bType > 3));
  713.     editorTemplate -dimControl $node "texUniformity" $val;    
  714.     editorTemplate -dimControl $node "repeatU" $val;
  715.     editorTemplate -dimControl $node "repeatV" $val;
  716.     editorTemplate -dimControl $node "offsetU" $val;
  717.     editorTemplate -dimControl $node "offsetV" $val;
  718.     editorTemplate -dimControl $node "blurMult" $val;
  719.     editorTemplate -dimControl $node "smear" $val;
  720.     editorTemplate -dimControl $node "smearU" $val;
  721.     editorTemplate -dimControl $node "smearV" $val;
  722.     editorTemplate -dimControl $node "imageName" ($val || $ttype != 4);
  723.     editorTemplate -dimControl $node "fringeRemoval" ($val || $ttype != 4);
  724.     editorTemplate -dimControl $node "fractalAmplitude" ($val || $ttype != 3);
  725.     editorTemplate -dimControl $node "fractalRatio" ($val || $ttype != 3);
  726.     editorTemplate -dimControl $node "fractalThreshold" ($val || $ttype != 3);
  727. }
  728.     
  729.  
  730.  
  731. global proc checkIllumination( string $node )
  732. {
  733.     global string $gAEbrushControls[];
  734.     int $val = `getAttr ($node+".illuminated")`;
  735.     int $val2 = `getAttr ($node+".realLights")`;
  736.     int $tOn = `getAttr ($node+".tubes")`;
  737.     int $bType = `getAttr ($node+".brushType")`;
  738.     
  739.     editorTemplate -dimControl $node "realLights" (!$val);
  740.     editorTemplate -dimControl $node "lightDirection" (!$val || $val2);
  741.     editorTemplate -dimControl $node "translucence" (!$val);
  742.     editorTemplate -dimControl $node "specular" (!$val);
  743.     editorTemplate -dimControl $node "specularPower" (!$val);
  744. //    editorTemplate -dimControl $node "specularColor" (!$val);
  745.  
  746.     //    Bug fix #117048.  The dangers of using global strings...
  747.     //
  748.     //    The global string values are not reset to null when the corresponding
  749.     //    controls are deleted.  To fix this, simply ensure the control exists
  750.     //    before editting it.  27jul99 - bwk
  751.     //
  752.     if (`attrColorSliderGrp -exists $gAEbrushControls[9]`) {
  753.         attrColorSliderGrp -edit -en $val $gAEbrushControls[9];
  754.     }
  755.     
  756.     editorTemplate -dimControl $node "leafTranslucence" (!$val || !$tOn);
  757.     editorTemplate -dimControl $node "flowerTranslucence" (!$val || !$tOn);
  758.     editorTemplate -dimControl $node "leafSpecular" (!$val || !$tOn);
  759.     editorTemplate -dimControl $node "flowerSpecular" (!$val || !$tOn);
  760.  
  761.     int $dim =($bType !=4) || (!$val);
  762.     editorTemplate -dimControl $node "multiStreakSpecularRand" $dim;
  763.     editorTemplate -dimControl $node "multiStreakLightAll" $dim;
  764.  
  765.     // if brush is not mesh, or not illuminated, perPixelLighting is dimmed
  766.     int $isMesh = ($bType == 5);
  767.     editorTemplate -dimControl $node "perPixelLighting" (!$isMesh || !$val);
  768. }
  769.  
  770.  
  771. global proc checkFakeShadow( string $node )
  772. {
  773.     int $val = `getAttr ($node+".fakeShadow")`;
  774.     int $bType = `getAttr ($node+".brushType")`;
  775.     int $dim = ($val == 0) || ($bType > 3);
  776.     editorTemplate -dimControl $node "shadowDiffusion" $dim;
  777.     editorTemplate -dimControl $node "shadowTransparency" $dim;
  778.     editorTemplate -dimControl $node "shadowOffset" ($val != 1);
  779. }
  780.  
  781.  
  782. global proc checkBranches ( string $node )
  783. {
  784.     int $tOn = `getAttr ($node+".tubes")`;
  785.     int $bOn = `getAttr ($node+".branches")`;
  786.     int $dim = !$tOn || !$bOn;
  787.     
  788.     editorTemplate -dimControl $node "branches" (!$tOn);
  789.     editorTemplate -dimControl $node "startBranches" $dim;
  790.     editorTemplate -dimControl $node "numBranches" $dim;
  791.     editorTemplate -dimControl $node "splitMaxDepth" $dim;
  792.     editorTemplate -dimControl $node "branchDropout" $dim;
  793.     editorTemplate -dimControl $node "splitRand" $dim;
  794.     editorTemplate -dimControl $node "splitAngle" $dim;
  795.     editorTemplate -dimControl $node "splitTwist" $dim;
  796.     editorTemplate -dimControl $node "splitSizeDecay" $dim;            
  797.     editorTemplate -dimControl $node "splitBias" $dim;
  798.     editorTemplate -dimControl $node "splitTwist" $dim;
  799.     editorTemplate -dimControl $node "minSize" $dim;
  800.     editorTemplate -dimControl $node "middleBranch" $dim;
  801. }
  802.     
  803.  
  804. global proc checkTwigs ( string $node )
  805. {
  806.     int $tOn = `getAttr ($node+".tubes")`;
  807.     int $bOn = `getAttr ($node+".twigs")`;
  808.     int $dim = !$tOn || !$bOn;
  809.     int $bType = `getAttr ($node+".brushType")`;
  810.     int $isMesh = ($bType == 5);
  811.  
  812.     editorTemplate -dimControl $node "twigs" (!$tOn);
  813.     editorTemplate -dimControl $node "twigsInCluster" $dim;
  814.     editorTemplate -dimControl $node "numTwigClusters" $dim;
  815.     editorTemplate -dimControl $node "twigDropout" $dim;
  816.     editorTemplate -dimControl $node "twigLength" $dim;
  817.     editorTemplate -dimControl $node "twigBaseWidth" $dim;
  818.     editorTemplate -dimControl $node "twigTipWidth" $dim;
  819.     editorTemplate -dimControl $node "twigStart" $dim;
  820.     editorTemplate -dimControl $node "twigAngle1" $dim;
  821.     editorTemplate -dimControl $node "twigAngle2" $dim;
  822.     editorTemplate -dimControl $node "twigTwist" $dim;
  823.     editorTemplate -dimControl $node "twigStiffness" $dim;
  824.     editorTemplate -dimControl $node "twigThorns" ($dim || !$isMesh);
  825.     editorTemplate -dimControl $node "branchAfterTwigs" $dim;
  826.     editorTemplate -dimControl $node "twigLengthScale" $dim;
  827.     editorTemplate -dimControl $node "twigLengthScale_Interp" $dim;
  828. }
  829.  
  830. global proc checkLeafUseBranchTex ( string $node )
  831. {
  832.     global string $gAEbrushControls[];
  833.     int $tOn = `getAttr ($node+".tubes")`;
  834.     int $lOn = `getAttr ($node+".leaves")`;
  835.     int $uOn = `getAttr ($node+".leafUseBranchTex")`;
  836.     int $dim = !$tOn || !$lOn || $uOn;
  837.     editorTemplate -dimControl $node "leafImage" $dim;
  838. }
  839.  
  840. global proc checkLeaves ( string $node )
  841. {
  842.     global string $gAEbrushControls[];
  843.     int $tOn = `getAttr ($node+".tubes")`;
  844.     int $lOn = `getAttr ($node+".leaves")`;
  845.     int $iOn = `getAttr ($node+".illuminated")`;
  846.     int $dim = !$tOn || !$lOn;
  847.     int $bType = `getAttr ($node+".brushType")`;
  848.     int $isMesh = ($bType == 5);
  849.     editorTemplate -dimControl $node "leaves" (!$tOn);
  850.     editorTemplate -dimControl $node "leavesInCluster" $dim;
  851.     editorTemplate -dimControl $node "numLeafClusters" $dim;
  852.     editorTemplate -dimControl $node "leafDropout" $dim;
  853.     editorTemplate -dimControl $node "leafLength" $dim;
  854.     editorTemplate -dimControl $node "leafBaseWidth" $dim;
  855.     editorTemplate -dimControl $node "leafTipWidth" $dim;
  856.     editorTemplate -dimControl $node "leafStart" $dim;
  857.     editorTemplate -dimControl $node "leafAngle1" $dim;
  858.     editorTemplate -dimControl $node "leafAngle2" $dim;
  859.     editorTemplate -dimControl $node "leafTwist" $dim;
  860.     editorTemplate -dimControl $node "leafSegments" $dim;
  861.     editorTemplate -dimControl $node "leafFlatness" $dim;
  862.     editorTemplate -dimControl $node "leafSizeDecay" $dim;
  863.     editorTemplate -dimControl $node "leafTranslucence" ($dim || !$iOn);
  864.     editorTemplate -dimControl $node "terminalLeaf" $dim;
  865.     editorTemplate -dimControl $node "leafWidthScale" $dim;
  866.     editorTemplate -dimControl $node "leafWidthScale_Interp" $dim;
  867.     editorTemplate -dimControl $node "leafBend" $dim;
  868.     editorTemplate -dimControl $node "leafCurl" $dim;
  869.     editorTemplate -dimControl $node "leafCurl_Interp" $dim;
  870.     editorTemplate -dimControl $node "leafTwirl" $dim;
  871.     editorTemplate -dimControl $node "leafStiffness" $dim;
  872.     editorTemplate -dimControl $node "leafSpecular" ($dim || (!$iOn));
  873.     editorTemplate -dimControl $node "leafThorns" ($dim || (!$isMesh));
  874.     editorTemplate -dimControl $node "leafReflectivity" ($dim || (!$isMesh));
  875. //    editorTemplate -dimControl $node "leafColor1" $dim;
  876. //    editorTemplate -dimControl $node "leafColor2" $dim;
  877.  
  878.     //    Bug fix #117048.  The dangers of using global strings...
  879.     //
  880.     //    The global string values are not reset to null when the corresponding
  881.     //    controls are deleted.  To fix this, simply ensure the control exists
  882.     //    before editting it.  27jul99 - bwk
  883.     //
  884.     if (`attrColorSliderGrp -exists $gAEbrushControls[11]`) {
  885.         attrColorSliderGrp -edit -en (!$dim) $gAEbrushControls[11];
  886.     }
  887.     if (`attrColorSliderGrp -exists $gAEbrushControls[12]`) {
  888.         attrColorSliderGrp -edit -en (!$dim) $gAEbrushControls[12];
  889.     }
  890.     
  891.     editorTemplate -dimControl $node "leafHueRand" $dim;
  892.     editorTemplate -dimControl $node "leafSatRand" $dim;
  893.     editorTemplate -dimControl $node "leafValRand" $dim;
  894.     editorTemplate -dimControl $node "leafUseBranchTex" $dim;
  895.     checkLeafUseBranchTex( $node );
  896. }
  897.  
  898.  
  899. global proc checkType ( string $node )
  900. {
  901.     //    Temporary Maya 2.5 fix for bug #117249.  Ensure the object exists to 
  902.     //    prevent error message from being printed.
  903.     //    09aug99 - bwk
  904.     //
  905.     if (!`objExists $node`) return;
  906.     int $bType = `getAttr ($node+".brushType")`;
  907.     int $illum = `getAttr ($node+".illuminated")`;
  908.     int $leaves = `getAttr ($node+".leaves")`;
  909.     int $flowers = `getAttr ($node+".flowers")`;
  910.     int $tubes = `getAttr ($node+".tubes")`;
  911.     $leaves = $leaves && $tubes;
  912.     $flowers = $flowers && $tubes;
  913.     editorTemplate -dimControl $node "blurIntensity" (!($bType == 2));
  914.     int $isThinLine = ($bType == 4);
  915.     int $isMesh = ($bType == 5);
  916.     editorTemplate -dimControl $node "stampDensity" ($bType > 3);
  917.     editorTemplate -dimControl $node "edgeAntialias" ($bType > 3);
  918.     checkThorns( $node );
  919.     checkFakeShadow( $node );
  920.     checkMapping( $node );
  921.     int $dim = !$isThinLine;
  922.     editorTemplate -dimControl $node "multiStreaks" $dim;
  923.     editorTemplate -dimControl $node "multiStreakSpread1" $dim;
  924.     editorTemplate -dimControl $node "multiStreakSpread2" ($dim || !$tubes);
  925.     editorTemplate -dimControl $node "multiStreakDiffuseRand" $dim;
  926.     editorTemplate -dimControl $node "multiStreakSpecularRand" ($dim || (!$illum));
  927.     editorTemplate -dimControl $node "multiStreakLightAll" ($dim || (!$illum));
  928.     $dim = $isThinLine;
  929.     editorTemplate -dimControl $node "flatness1" $dim;
  930.     editorTemplate -dimControl $node "flatness2" ($dim || !$tubes);
  931.     editorTemplate -dimControl $node "softness" $dim;
  932.     $dim = !$isMesh;
  933.     editorTemplate -dimControl $node "environment" $dim;
  934.     editorTemplate -dimControl $node "environment_Interp" $dim;
  935.     editorTemplate -dimControl $node "reflectionRolloff" $dim;
  936.     editorTemplate -dimControl $node "reflectionRolloff_Interp" $dim;
  937.     editorTemplate -dimControl $node "branchReflectivity" $dim;
  938.     editorTemplate -dimControl $node "leafReflectivity" ($dim || (!$leaves));
  939.     editorTemplate -dimControl $node "flowerReflectivity" ($dim || (!$flowers));
  940.     editorTemplate -dimControl $node "singleSided" $dim;
  941.     editorTemplate -dimControl $node "perPixelLighting" ($dim || (!$illum));
  942.  
  943.  
  944.     
  945. }
  946.  
  947. global proc checkThorns( string $node )
  948. {
  949.     int $bType = `getAttr ($node+".brushType")`;
  950.     int $flowers = `getAttr ($node+".flowers")`;
  951.     int $leaves = `getAttr ($node+".leaves")`;
  952.     int $twigs = `getAttr ($node+".twigs")`;
  953.     int $tubes = `getAttr ($node+".tubes")`;
  954.     $leaves = $leaves && $tubes;
  955.     $flowers = $flowers && $tubes;
  956.     $twigs = $twigs && $tubes;
  957.     int $isMesh = ($bType == 5);
  958.     int $dim = !$isMesh;
  959.     editorTemplate -dimControl $node "branchThorns" $dim;
  960.     editorTemplate -dimControl $node "twigThorns" ($dim || !$twigs);
  961.     editorTemplate -dimControl $node "leafThorns" ($dim || !$leaves);
  962.     editorTemplate -dimControl $node "flowerThorns" ($dim || !$flowers);
  963.     if( !$dim ){
  964.         int $isThorn = (`getAttr ($node+".branchThorns")`
  965.                     || `getAttr ($node+".twigThorns")`
  966.                     || `getAttr ($node+".leafThorns")`
  967.                     || `getAttr ($node+".flowerThorns")`);
  968.         $dim = $dim || (!$isThorn);
  969.     }
  970.  
  971.     editorTemplate -dimControl $node "thornDensity" $dim;
  972.     editorTemplate -dimControl $node "thornElevation" $dim;
  973.     editorTemplate -dimControl $node "thornLength" $dim;
  974.     editorTemplate -dimControl $node "thornBaseWidth" $dim;
  975.     editorTemplate -dimControl $node "thornTipWidth" $dim;
  976.     editorTemplate -dimControl $node "thornSpecular" $dim;
  977.     editorTemplate -dimControl $node "thornBaseColor" $dim;
  978.     editorTemplate -dimControl $node "thornTipColor" $dim;
  979. }
  980.  
  981.  
  982. global proc checkDepth ( string $node )
  983. {
  984.     int $dOn = `getAttr ($node+".depth")`;
  985.     editorTemplate -dimControl $node "modifyDepth" (!$dOn);
  986. }
  987.  
  988. global proc checkFlowerUseBranchTex ( string $node )
  989. {
  990.     global string $gAEbrushControls[];
  991.     int $tOn = `getAttr ($node+".tubes")`;
  992.     int $lOn = `getAttr ($node+".flowers")`;
  993.     int $uOn = `getAttr ($node+".flowerUseBranchTex")`;
  994.     int $dim = !$tOn || !$lOn || $uOn;
  995.     editorTemplate -dimControl $node "flowerImage" $dim;
  996. }
  997.  
  998. global proc checkFlowers ( string $node )
  999. {
  1000.     global string $gAEbrushControls[];
  1001.     int $tOn = `getAttr ($node+".tubes")`;
  1002.     int $fOn = `getAttr ($node+".flowers")`;
  1003.     int $iOn = `getAttr ($node+".illuminated")`;
  1004.     int $dim = !$tOn || !$fOn;
  1005.     int $bType = `getAttr ($node+".brushType")`;
  1006.     int $isMesh = ($bType == 5);
  1007.  
  1008.     editorTemplate -dimControl $node "flowers" (!$tOn);
  1009.     editorTemplate -dimControl $node "petalsInFlower" $dim;
  1010.     editorTemplate -dimControl $node "numFlowers" $dim;
  1011.     editorTemplate -dimControl $node "petalDropout" $dim;
  1012.     editorTemplate -dimControl $node "petalLength" $dim;
  1013.     editorTemplate -dimControl $node "petalBaseWidth" $dim;
  1014.     editorTemplate -dimControl $node "petalTipWidth" $dim;
  1015.     editorTemplate -dimControl $node "flowerStart" $dim;
  1016.     editorTemplate -dimControl $node "flowerAngle1" $dim;
  1017.     editorTemplate -dimControl $node "flowerAngle2" $dim;
  1018.     editorTemplate -dimControl $node "flowerTwist" $dim;
  1019.     editorTemplate -dimControl $node "petalSegments" $dim;
  1020.     editorTemplate -dimControl $node "petalFlatness" $dim;
  1021.     editorTemplate -dimControl $node "flowerSizeDecay" $dim;
  1022.     editorTemplate -dimControl $node "flowerTranslucence" ($dim || !$iOn);
  1023.     editorTemplate -dimControl $node "flowerSpecular" ($dim || !$iOn);
  1024.     editorTemplate -dimControl $node "flowerThorns" ($dim || !$isMesh);
  1025.     editorTemplate -dimControl $node "flowerReflectivity" ($dim || (!$isMesh));
  1026.     editorTemplate -dimControl $node "petalWidthScale" $dim;
  1027.     editorTemplate -dimControl $node "petalWidthScale_Interp" $dim;
  1028.     editorTemplate -dimControl $node "petalBend" $dim;
  1029.     editorTemplate -dimControl $node "petalCurl" $dim;
  1030.     editorTemplate -dimControl $node "petalCurl_Interp" $dim;
  1031.     editorTemplate -dimControl $node "petalTwirl" $dim;
  1032.     editorTemplate -dimControl $node "flowerStiffness" $dim;
  1033. //    editorTemplate -dimControl $node "petalColor1" $dim;
  1034. //    editorTemplate -dimControl $node "petalColor2" $dim;
  1035.  
  1036.     //    Bug fix #117048.  The dangers of using global strings...
  1037.     //
  1038.     //    The global string values are not reset to null when the corresponding
  1039.     //    controls are deleted.  To fix this, simply ensure the control exists
  1040.     //    before editting it.  27jul99 - bwk
  1041.     //
  1042.     if (`attrColorSliderGrp -exists $gAEbrushControls[13]`) {
  1043.         attrColorSliderGrp -edit -en (!$dim) $gAEbrushControls[13];
  1044.     }
  1045.     if (`attrColorSliderGrp -exists $gAEbrushControls[14]`) {
  1046.         attrColorSliderGrp -edit -en (!$dim) $gAEbrushControls[14];
  1047.     }
  1048.     
  1049.     editorTemplate -dimControl $node "flowerHueRand" $dim;
  1050.     editorTemplate -dimControl $node "flowerSatRand" $dim;                    
  1051.     editorTemplate -dimControl $node "flowerValRand" $dim;
  1052.     editorTemplate -dimControl $node "flowerUseBranchTex" $dim;
  1053.     checkFlowerUseBranchTex( $node );
  1054. }
  1055.  
  1056.  
  1057.  
  1058. global proc checkBuds ( string $node )
  1059. {
  1060.     global string $gAEbrushControls[];
  1061.     int $tOn = `getAttr ($node+".tubes")`;
  1062.     int $bOn = `getAttr ($node+".buds")`;
  1063.     int $dim = !$tOn || !$bOn;
  1064.     
  1065.     editorTemplate -dimControl $node "buds" (!$tOn);
  1066.     editorTemplate -dimControl $node "budSize" $dim;
  1067. //    editorTemplate -dimControl $node "budColor" $dim;
  1068.  
  1069.     //    Bug fix #117048.  The dangers of using global strings...
  1070.     //
  1071.     //    The global string values are not reset to null when the corresponding
  1072.     //    controls are deleted.  To fix this, simply ensure the control exists
  1073.     //    before editting it.  27jul99 - bwk
  1074.     //
  1075.     if (`attrColorSliderGrp -exists $gAEbrushControls[15]`) {
  1076.         attrColorSliderGrp -edit -en (!$dim) $gAEbrushControls[15];
  1077.     }
  1078. }
  1079.  
  1080.  
  1081. global proc checkDeflection ( string $node )
  1082. {
  1083.     int $tOn = `getAttr ($node+".tubes")`;
  1084.     int $dOn = `getAttr ($node+".deflection")`;
  1085.     int $dim = !$tOn || !$dOn;
  1086.     editorTemplate -dimControl $node "deflection" (!$tOn);
  1087.     editorTemplate -dimControl $node "deflectionMin" $dim;
  1088.     editorTemplate -dimControl $node "deflectionMax" $dim;
  1089. }
  1090.  
  1091.  
  1092. global proc checkTurbulence ( string $node )
  1093. {
  1094.     int $tOn = `getAttr ($node+".tubes")`;
  1095.     int $ttOn = `getAttr ($node+".turbulenceType")`;
  1096.     int $dim = !$tOn || ($ttOn == 0);
  1097.     
  1098.     editorTemplate -dimControl $node "turbulenceType" (!$tOn);
  1099.     editorTemplate -dimControl $node "turbulenceInterpolation" $dim;
  1100.     editorTemplate -dimControl $node "turbulence" $dim;
  1101.     editorTemplate -dimControl $node "turbulenceFrequency" $dim;
  1102.     editorTemplate -dimControl $node "turbulenceSpeed" $dim;
  1103.     editorTemplate -dimControl $node "turbulenceOffset" $dim;
  1104. }
  1105.  
  1106.  
  1107. global proc checkTimeClip ( string $node )
  1108. {
  1109.     int $tOn = `getAttr ($node+".timeClip")`;
  1110.     int $dim = !$tOn;
  1111.     editorTemplate -dimControl $node "startTime" $dim;
  1112.     editorTemplate -dimControl $node "endTime" $dim;
  1113. }
  1114.     
  1115.  
  1116. global proc checkTubes ( string $node )
  1117. {
  1118.     global string $gAEbrushControls[];
  1119.     int $tOn = `getAttr ($node+".tubes")`;
  1120.     int $tOff = !$tOn;
  1121.  
  1122.     int $bType = `getAttr ($node+".brushType")`;
  1123.     int $isThinLine = ($bType == 4);
  1124.     
  1125.     editorTemplate -dimControl $node "tubeCompletion" $tOff;
  1126.     editorTemplate -dimControl $node "simplifyMethod" $tOff;
  1127.     editorTemplate -dimControl $node "tubesPerStep" $tOff;
  1128.     editorTemplate -dimControl $node "startTubes" $tOff;
  1129.     editorTemplate -dimControl $node "lengthMin" $tOff;
  1130.     editorTemplate -dimControl $node "lengthMax" $tOff;
  1131.     editorTemplate -dimControl $node "tubeWidth1" $tOff;
  1132.     editorTemplate -dimControl $node "tubeWidth2" $tOff;
  1133.     editorTemplate -dimControl $node "widthRand" $tOff;
  1134.     editorTemplate -dimControl $node "widthBias" $tOff;
  1135.     editorTemplate -dimControl $node "segments" $tOff;
  1136.     editorTemplate -dimControl $node "segmentLengthBias" $tOff;
  1137.     editorTemplate -dimControl $node "segmentWidthBias" $tOff;
  1138.     editorTemplate -dimControl $node "tubeDirection" $tOff;
  1139.     editorTemplate -dimControl $node "tubeRand" $tOff;
  1140.     editorTemplate -dimControl $node "elevationMin" $tOff;
  1141.     editorTemplate -dimControl $node "elevationMax" $tOff;
  1142.     editorTemplate -dimControl $node "azimuthMin" $tOff;
  1143.     editorTemplate -dimControl $node "azimuthMax" $tOff;
  1144.  
  1145.  
  1146. //    editorTemplate -dimControl $node "color2" $tOff;
  1147. //    editorTemplate -dimControl $node "incandescence2" $tOff;
  1148. //    editorTemplate -dimControl $node "transparency2" $tOff;
  1149.  
  1150.     //    Bug fix #117048.  The dangers of using global strings...
  1151.     //
  1152.     //    The global string values are not reset to null when the corresponding
  1153.     //    controls are deleted.  To fix this, simply ensure the control exists
  1154.     //    before editting it.  27jul99 - bwk
  1155.     //
  1156.     if (`attrColorSliderGrp -exists $gAEbrushControls[4]`) {
  1157.         attrColorSliderGrp -edit -en $tOn $gAEbrushControls[4];
  1158.     }
  1159.     if (`attrColorSliderGrp -exists $gAEbrushControls[5]`) {
  1160.         attrColorSliderGrp -edit -en $tOn $gAEbrushControls[5];
  1161.     }
  1162.     if (`attrColorSliderGrp -exists $gAEbrushControls[6]`) {
  1163.         attrColorSliderGrp -edit -en $tOn $gAEbrushControls[6];
  1164.     }
  1165.  
  1166.     editorTemplate -dimControl $node "flatness2" ($tOff || $isThinLine);
  1167.     editorTemplate -dimControl $node "brightnessRand" $tOff;
  1168.     editorTemplate -dimControl $node "rootFade" $tOff;
  1169.     editorTemplate -dimControl $node "tipFade" $tOff;
  1170.     editorTemplate -dimControl $node "hueRand" $tOff;
  1171.     editorTemplate -dimControl $node "satRand" $tOff;
  1172.     editorTemplate -dimControl $node "valRand" $tOff;
  1173.     
  1174.     checkBranches( $node );
  1175.     checkTwigs( $node );
  1176.     checkLeaves( $node );
  1177.     checkFlowers( $node );
  1178.     checkBuds( $node );
  1179.     
  1180.     editorTemplate -dimControl $node "displacementDelay" $tOff;
  1181.     editorTemplate -dimControl $node "noise" $tOff;
  1182.     editorTemplate -dimControl $node "noiseFrequency" $tOff;
  1183.     editorTemplate -dimControl $node "noiseOffset" $tOff;
  1184.     editorTemplate -dimControl $node "wiggle" $tOff;
  1185.     editorTemplate -dimControl $node "wiggleFrequency" $tOff;
  1186.     editorTemplate -dimControl $node "wiggleOffset" $tOff;
  1187.     editorTemplate -dimControl $node "curl" $tOff;
  1188.     editorTemplate -dimControl $node "curlFrequency" $tOff;
  1189.     editorTemplate -dimControl $node "curlOffset" $tOff;
  1190.                     
  1191.     editorTemplate -dimControl $node "pathFollow" $tOff;
  1192.     editorTemplate -dimControl $node "pathAttract" $tOff;
  1193.     editorTemplate -dimControl $node "curveFollow" $tOff;
  1194.     editorTemplate -dimControl $node "curveAttract" $tOff;
  1195.     editorTemplate -dimControl $node "curveMaxDist" $tOff;
  1196.     editorTemplate -dimControl $node "random" $tOff;
  1197.     editorTemplate -dimControl $node "uniformForce" $tOff;
  1198.     editorTemplate -dimControl $node "gravity" $tOff;
  1199.                     
  1200.     checkDeflection( $node );
  1201.  
  1202.     editorTemplate -dimControl $node "momentum" $tOff;
  1203.     editorTemplate -dimControl $node "lengthFlex" $tOff;
  1204.     
  1205.     checkTurbulence( $node );
  1206.     
  1207.     editorTemplate -dimControl $node "spiralMin" $tOff;
  1208.     editorTemplate -dimControl $node "spiralMax" $tOff;
  1209.     editorTemplate -dimControl $node "spiralDecay" $tOff;
  1210.                     
  1211.     editorTemplate -dimControl $node "twistRate" $tOff;
  1212.     editorTemplate -dimControl $node "twistRand" $tOff;
  1213.  
  1214.     checkTimeClip( $node );
  1215.         
  1216.     editorTemplate -dimControl $node "colorLengthMap" $tOff;
  1217.     editorTemplate -dimControl $node "transpLengthMap" $tOff;
  1218.     editorTemplate -dimControl $node "incandLengthMap" $tOff;
  1219.     editorTemplate -dimControl $node "widthLengthMap" $tOff;
  1220.     editorTemplate -dimControl $node "splitLengthMap" $tOff;
  1221.  
  1222.     editorTemplate -dimControl $node "creationScript" $tOff;
  1223.     editorTemplate -dimControl $node "runtimeScript" $tOff;
  1224.  
  1225.     editorTemplate -dimControl $node "multiStreakSpread2" ($tOff || !$isThinLine);
  1226.  
  1227. }
  1228.         
  1229.